package com.synergy.stockflow.production.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "production_report")
public class ProductionReport {
    /**
     * 报工ID
     */
    @TableId(value = "report_id", type = IdType.ASSIGN_ID)
    @Schema(description="报工ID")
    private String reportId;

    /**
     * 报工编号
     */
    @TableField(value = "report_code")
    @Schema(description="报工编号")
    private String reportCode;

    /**
     * 生产计划ID
     */
    @TableField(value = "production_plan_id")
    @Schema(description="生产计划ID")
    private String productionPlanId;

    /**
     * 任务ID
     */
    @TableField(value = "task_id")
    @Schema(description="任务ID")
    private String taskId;

    /**
     * 报工人员ID
     */
    @TableField(value = "report_people_id")
    @Schema(description="报工人员ID")
    private String reportPeopleId;

    /**
     * 报工时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "report_time")
    @Schema(description="报工时间")
    private Date reportTime;

    /**
     * 状态(0=未确认,1=已确认)
     */
    @TableField(value = "`status`")
    @Schema(description="状态(0=未确认,1=已确认)")
    private Integer status;

    /**
     * 总报工数量
     */
    @TableField(value = "total_quantity")
    @Schema(description="总报工数量")
    private BigDecimal totalQuantity;

    /**
     * 合格数量
     */
    @TableField(value = "qualified_quantity")
    @Schema(description="合格数量")
    private BigDecimal qualifiedQuantity;

    /**
     * 不合格数量
     */
    @TableField(value = "defect_quantity")
    @Schema(description="不合格数量")
    private BigDecimal defectQuantity;

    /**
     * 开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "start_date")
    @Schema(description="开始日期")
    private Date startDate;

    /**
     * 结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "end_date")
    @Schema(description="结束日期")
    private Date endDate;

    /**
     * 实际耗时(分钟)
     */
    @TableField(value = "duration_minutes")
    @Schema(description="实际耗时(分钟)")
    private Integer durationMinutes;

    /**
     * 质检员ID
     */
    @TableField(value = "check_id")
    @Schema(description="质检员ID")
    private String checkId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "create_time")
    @Schema(description="创建时间")
    private Date createTime;

    @TableField(exist = false)
    private List<ProductionReportDetail> productionReportDetails;

    @TableField(value = "pass_rate")
    private BigDecimal passRate;

    @TableField(exist = false)
    private String materialId;

    @TableField(exist = false)
    private String materialName;

    @TableField(exist = false)
    private String specificationsAndModels;

    @TableField(exist = false)
    private String unit;


}